home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / sjcsfo.zip / PTBEDIT.TXT < prev    next >
Text File  |  1992-11-24  |  7KB  |  166 lines

  1. FIRST DRAFT OF A TEXT ON EDITING .TXT FILES MADE WITH TOOLBOX
  2.  
  3. Some of the suggestions below have been implemented in
  4. SJCSFO.TXT. To see the"original" of that text, simply make up a
  5. flight plan with Flight Planner and run it through ToolBox.
  6. _____________________________________________
  7.  
  8.         On editing .TXTs made with Robert Mackay's ToolBox
  9.  
  10. One of the nice things about Robert Mackay's Pilot's ToolBox is
  11. the possibility of editing the .TXT files produced by the AAF
  12. Factory module and changing them before compiling with AAF.EXE
  13. (AAF YOURFILE.TXT YOURFILE.ADV). ToolBox .TXT files are straight
  14. ASCII, and can therefore be edited with any word processor which
  15. can handle such texts. It will be helpful if it has Search and
  16. Search/Replace functions.
  17.  
  18. Here are a few suggestions:
  19.  
  20. First thing to do is to find the proper ground, tower, and
  21. departure/approach frequencies for the airports, and substitute
  22. them both in the messages and in the appropriate IF COM()'s. Get
  23. these from the Airport and Facilties Directories, or from IAPs.
  24. And you might have an improvement for the Center frequency.
  25.  
  26. Airport names in the original .FPD from which the .PLN was made,
  27. in turn used by the ToolBox, can only be a certain number of
  28. characters long, and therefore they will be truncated in the .TXT
  29. file (e. g., "Interna" for "International". These are easily
  30. edited.
  31.  
  32. I myself always eliminate the SETPOSITION line, and set up a mode
  33. which gets me in the right position for the flight. You can thus
  34. load this mode, and then load the corresponding adventure with
  35. the proper choice in your Adventure menu (option 3). Same name,
  36. of course, but not extension.
  37.  
  38. I also stick in other PRINT lines, such as giving the frequencies
  39. of VORs when they are not otherwise provided. And of course you
  40. can edit any PRINT statement, or omit ones you don't think are
  41. appropriate.
  42.  
  43. You are *not* bound to take off from the runway provided by your
  44. Flight Planner plan. ToolBox picks the takekoff runway at random
  45. from those specified in the .FPD file. You can change this -- in
  46. the relevant PRINT statements, and in the IF HEADING(X,Y) checks
  47. for departure from proper runway (LOOP2B).
  48.  
  49. Landing runways in ToolBox are either an ILS runway, or a runway
  50. chosen at random (in the case of two or more ILS runways, again a
  51. random choice). You can also change that *landing* runway, but if
  52. you do this, you also have to change the bearings and directions
  53. of turns for downwind, base, and final, and this is a little
  54. tricky -- some variables have to be changed for the automatic
  55. pilot, too (following lines beginning "SETVAR(M,xxxx)", where
  56. xxxx is the new heading). Some experimentation will be necessary.
  57.  
  58. The toolbox depends on the information in your .FPD being
  59. correct. If not, you'll get screwy results in the .ADV. For
  60. example, I note that BDL (Bradley) has *no* runways in SD-12.FPD!
  61. Edit it. This is also the case if you don't have the right
  62. runways, ILS frequencies, etc., not to mention wrong FS
  63. coordinates.
  64.  
  65. In some of my adventures I like to remind myself that a certain
  66. scenery disk and certain ASD scenery is required. There is a
  67. simple routine to do this:
  68.  
  69. reminder:
  70.  
  71. PRINT "SD-12 and MASBOS12.SC1 required - acknowledge with 'x'"
  72. if key("x")
  73.      goto OPTIONS
  74. endif
  75. goto reminder
  76.  
  77. Put this in before the OPTIONS loop in the .TXT file.
  78.  
  79. Other fine tuning is a little more complicated, and often depends
  80. on your knowledge of the basic structure of the .TXT file. For
  81. example, if you find that you're too close for Approach's
  82. instruction to turn for downwind, look for a preceding IF
  83. CYLINDER(x,y,nn,nnn) statement. X and Y there are the FS
  84. coordinates of the point you're heading for; nn is usually 0, and
  85. nnn is the one you might want to change. Increasing nnn will make
  86. the command pop up earlier, decreasing later. (See AAF
  87. documentation for such things.)
  88.  
  89. Want a subroutine to do something special, such as VIEW a .PCX
  90. file of your approach plate? Write a new subroutine and put a
  91. GOSUB VIEWIAP in every loop where you want this to be active
  92. (there are several such GOSUBs in the loops of the basic .TXT
  93. already). In that case your subroutine might read:
  94.  
  95. VIEWIAP:
  96.  
  97. if key("7")
  98.      VIEW(10,"MYIAP.PCX")
  99. endif
  100. RETURN
  101.  
  102. Whenever this subroutine is called, if the user hits "7",
  103. MYIAP.PCX will appear on the screen for 10 seconds.
  104.  
  105. (Note: indentation of commands, as in the above, is not really
  106. necessary for AAF-BASIC -- it just makes it easier to read and
  107. understand.)
  108.  
  109. Writing whole new loops to do something not otherwise provided
  110. for is a tricky business, but not impossible. Simply follow the
  111. structure of the basic .TXT, write your loops, and be sure they
  112. are called by the next previous loop and in turn call the next
  113. following loop. 
  114.  
  115. For example, you might want to put in a new loop which will check
  116. your position over against the location and altitude of the FAF
  117. (final approach fix) for your destination runway, in the case of
  118. an ILS approach. One should be able to handle this with the IF
  119. GSLOPE(x,y) command in AAF-BASIC, but at the moment this does not
  120. seem to be working.
  121.  
  122. ___________________
  123.  
  124. Structure of .TXT files
  125.  
  126. Almost all AAF .TXT files are a series of "loops", some of which
  127. themselves contain other loops, and subroutines. You can think of
  128. loops as phases or legs of your trip, and subroutines as things
  129. you do from time to time.
  130.  
  131. Each loop begins with a label (LOOP:), and you enter such a loop
  132. with a command such as GOTO LOOP. Subroutines also have labels,
  133. and are entered with GOSUB WHATEVER. Subroutines conclude with
  134. the command RETURN.
  135.  
  136. Each loop looks for a certain condition to be fulfilled
  137. (altitude, setting of nav radios, distance from a certain point,
  138. value of a certain variable, etc.). Then a command is given [PLAY
  139. "MYVOC.VOC", PRINT "WE FULFILLED THE CONDITION", SETVAR(X,1),
  140. PRINTVAR(x,"Your altitude is: "), VIEW(10,"MYPCX.PCX")]. Usually
  141. after such a command or series of commands is issued you break
  142. out of the current loop with GOTO NEXTLOOP.
  143.  
  144. Most loops in .TXT files produced by the ToolBox have another
  145. subloop inside (LOOP1A, LOOP2A, etc.). This allows one to hit "R"
  146. at any point and go back one loop to repeat the PLAY or PRINT
  147. there, and proceed.
  148.  
  149. The conditions which must be fulfilled before a command is issued
  150. can be either/or, both/and, etc. (Boolean logic). AAF-BASIC is
  151. rather primitive, and these require some long programming.
  152.  
  153. Good programmers, like Robert Mackay, will provide their BASIC
  154. scripts with comments, usually lines beginning ;. In ToolBox .TXT
  155. files, for example, there is an explanation of the function of a
  156. loop at the top of each, or at least a note on what's happening
  157. (;Waiting for clearance). Note also that Robert has at the
  158. beginning a series of ; lines with names of variables and their
  159. function. If you write something new, be sure not to use these
  160. variables -- that way lies disaster. Also be sure not to use
  161. keypresses which are otherwise used in FS, and that's a problem:
  162. there aren't very many of them left over. And several are already
  163. used by the ToolBox .TXT file.
  164.  
  165.  
  166.